home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q32770 < prev    next >
Text File  |  1988-10-20  |  1KB  |  36 lines

  1. Q32770 Incorrect Code for Complicated Switch Statement
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.  
  8. The code generated for a specific source file that contained a switch
  9. block of 10 cases, with a statement within each case containing a
  10. dereferenced pointer to a struct with variable indexed char array
  11. members, generates incorrect when the code is compiled with large
  12. model.
  13.  
  14. The code that is generated uses the lea instruction in circumstances
  15. where it should be using the les instruction. (The code is large and
  16. complicated and is not included here.)
  17.  
  18. Microsoft has confirmed this to be a problem in Version 5.10. We
  19. are researching this problem and will post new information as it
  20. becomes available.  Two possible workarounds are described below.
  21.  
  22. More Information:
  23.  
  24. In some cases, a MOV BX, addr is generated rather than a LES BX, addr.
  25. The problem is that the ES register is not preserved over function
  26. calls, so using ES for addressing will be incorrect if ES has changed.
  27.  
  28. Changing from -Ox optimization to -Od eliminates the problem.  The
  29. problem can also be eliminated with careful (trial-and-error) use of
  30. temporary variables.  Check the generated code with CodeView before
  31. using it.
  32.  
  33.  
  34. Keywords:  buglist5.10
  35. Updated  88/10/21 03:46
  36.